package com.code.leetcode.offer;

import com.code.leetcode.utils.TreeNode;

/**
 * @author codeDorado
 * @version 1.0
 * @date 2020/8/4 10:28
 */
public class The55 {

    public int maxDepth(TreeNode root) {
        return dfs(root);
    }

    public int dfs(TreeNode root) {
        if (root == null) return 0;
        return Math.max(dfs(root.left) + 1, dfs(root.right) + 1);
    }

}
